export default {
  data() {
    return {
      list:[],
      limit:0,
      tabsList: ['可分红', '已分红'],
      current: 0
    };
  },

  mounted() {},

  created(){
    if (!localStorage.getItem("uid")) {
      this.$router.push(this.fun.getUrl("member"));
      return
    }
    this.getDividendInfo();
    this.getList();
    
  },

  methods: {
    getDividendInfo(){
      $http.post("HuanNiuJiuji.dividendInfo",{
        uid: localStorage.getItem("uid"),
      },"加载中").then(res=>{
        if(res.result == 1){
          this.limit = res.data.limit
        }
      })
    },
    changeTabs(index){
      this.current = index;
      this.getList();
    },
    getList(){
      $http.post("HuanNiuJiuji.dividendList",{
        uid: localStorage.getItem("uid"),
        type:this.current+1,
      },"加载中").then(res=>{
        if(res.result == 1){
          this.list = res.data
        }
        console.log(res,"可分红");
      })
    }
  }
};
